package com.simple.gateway.center.domian.manage.repository;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.simple.gateway.center.domian.manage.bo.GatewayDistributionBO;
import com.simple.gateway.center.domian.manage.bo.GatewayServerBO;
import com.simple.gateway.center.domian.manage.bo.GatewayServerDetailBO;
import com.simple.gateway.center.domian.manage.dto.GatewayServerDTO;
import com.simple.gateway.center.web.param.GatewayServerCompositeParam;

import java.util.List;

/**
 * 项目: simple-gateway-core
 * <p>
 * 功能描述: 网关配置仓储服务
 *
 * @author: WuChengXing
 * @create: 2023-08-07 11:35
 **/
public interface IConfigManageRepository {

    /**
     * 查询网关服务列表
     *
     * @return
     */
    List<GatewayServerBO> queryGatewayServerList();

    /**
     * 注册网关服务
     *
     * @param groupId
     * @param gatewayId
     * @param gatewayName
     * @param gatewayAddress
     * @param available
     * @return
     */
    boolean registerGatewayServerNode(String groupId, String gatewayId, String gatewayName, String gatewayAddress, Integer available);

    /**
     * 查询网关服务详情
     *
     * @param gatewayId
     * @param gatewayAddress
     * @return
     */
    GatewayServerDetailBO queryGatewayServerDetail(String gatewayId, String gatewayAddress);

    /**
     * 更新网关服务状态
     *
     * @param gatewayId
     * @param gatewayAddress
     * @param available
     * @return
     */
    boolean updateGatewayStatus(String gatewayId, String gatewayAddress, Integer available);

    /**
     * 查询所有的关联应用的建
     *
     * @param gatewayId
     * @return
     */
    List<String> queryGatewayDistributionSystemIdList(String gatewayId);

    /**
     * 根据系统查询关联关系
     *
     * @param systemId
     * @return
     */
    String queryGatewayDistribution(String systemId);

    /**
     * 根据网关名分页查询
     *
     * @param groupName
     * @param pageNum
     * @param pageSize
     * @return
     */
    Page<GatewayServerBO> pageGatewayServer(String groupName, Integer pageNum, Integer pageSize);

    /**
     * 查询网关详情
     * @param param
     * @return
     */
    Page<GatewayServerDetailBO> pageGatewayServerDetail(GatewayServerCompositeParam param);

    /**
     *
     * @param param
     * @return
     */
    Page<GatewayDistributionBO> pageGatewayDistribution(GatewayServerCompositeParam param);
}
